<?php
/**
*	adminBaseService.php
* 	后台基础Service层
* 	@author Yanling
*/
require_once 'baseService.php';
class adminService extends baseService {  

	/**
	*	@var 验证字段及规则
	*/
	protected $validate_rules = array();

	public function __construct(){
		parent::__construct();
		$this->ownDao = InitPHP::getDao('admin');
	}

	/**
	 * 验证管理员账号
	 *@param  account
	 *@param  password
	 *@return $admin 
	 */
	public function authAdminAccount($account,$password){
		//$password = ''; //加密
		return  $this->ownDao->findOneByFields(array('adm_account'=>$account,'adm_password'=>$password));
	}

	/**
	 * 记录管理员登录Session
	 * @param $admin
	 */
	public function logAdminLoginSession($admin){
		InitPHP::getUtils('session')->set('admin',$admin);
	}

	/**
	 * 验证管理员登录Session
	 * @param $admin
	 */
	public function authAdminLoginSession(){
		return InitPHP::getUtils('session')->get('admin');
	}

	/**
	 * 清楚管理员登录Session
	 * @param $admin
	 */
	public function clearAdminLoginSession(){
		InitPHP::getUtils('session')->clear();
	}

}